﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using ScrumFactory.Composition.ViewModel;
using ScrumFactory.Composition;

namespace ScrumFactory.Composition.ViewModel {

    public class BaseEditableObjectViewModel : INotifyPropertyChanged {

        public event PropertyChangedEventHandler PropertyChanged;

        private bool justHasBeenRemoved;
        private bool justHasBeenInserted;

        public bool JustHasBeenRemoved {
            get {
                return justHasBeenRemoved;
            }
            set {
                justHasBeenRemoved = value;
                OnPropertyChanged("JustHasBeenRemoved");
            }
        }

        public bool JustHasBeenInserted {
            get {
                return justHasBeenInserted;
            }
            set {
                justHasBeenInserted = value;
                OnPropertyChanged("JustHasBeenInserted");
            }
        }

        /// <summary>
        /// Called when a property has changed.
        /// </summary>
        /// <param name="property">The property.</param>
        protected void OnPropertyChanged(string property) {
            if (this.PropertyChanged != null)
                this.PropertyChanged(this, new PropertyChangedEventArgs(property));
        }

    }
}
